package com.qianfeng.openapi.zuul.utils;

import java.util.HashMap;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2020/12/29
 * @Time: 下午5:30
 */
public class R extends HashMap {

    private int code;
    private String msg;

    public R(){}
    public R(int code){
        super.put("code",code);
    }
    public R(int code, String msg){
        super.put("code",code);
        super.put("msg",msg);
    }

    public static  R ok(){
        return  new R(0);
    }

    public static  R ok(String msg){
        return  new R(0,msg);
    }

    public static  R fail(){
        return  new R(1);
    }
    public static  R fail(String msg){
        return  new R(1,msg);
    }

    public  R put(String key,Object value){
         super.put(key,value);
        return  this;
    }


}
